﻿@model Inscriptionem.Areas.Inscriptionem.Models.Views.LanguageViewModel

@{
    ViewBag.Title = "Inscriptionem » Languages » Edit Language";
    Layout = "../Shared/Layout.cshtml";

    ViewBag.CurrentPage = "Languages";

    string message = string.Empty;

    switch (Model.Error)
    {
        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.LanguageEmpty:
        {
            message = "Please enter Language.";
            break;
        }

        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.LanguageLocalizationEmpty:
        {
            message = "Please enter Language Name.";
            break;
        }

        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.LanguageAlreadyExists:
        {
            message = "Language already exists, try another one.";
            break;
        }


        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.OrderNotValid:
        {
            message = "Please enter valid order, a positive number.";
            break;
        }

        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.OrderAlreadyInUse:
        {
            message = "Entered order already in use by another Language, please enter different value";
            break;
        }

        case Inscriptionem.Areas.Inscriptionem.Models.Enums.LanguageError.Other:
        {
            message = "Unknown error occurred, please try again.";
            break;
        }
    }
}

<div class="outer" id="contentwrap">
    @{Html.RenderPartial("NavigationMenu");}
    <div class="postcont">
		<div id="content">
            <div class="post type-post status-publish format-standard hentry">
                <h2 class="title">Edit Language</h2>
                <div class="postdate-single error-message">@message</div>
                <hr />
                <form method="post" action="/Inscriptionem/Language/Edit">
                    <input type="hidden" name="ID" value="@Model.ID" />
				    <div class="entry">
                        <p>Order <input type="text" name="Order" value="@Model.Order" /></p>
                        <p>Language <input type="text" name="Name" value="@Model.Name" /></p>
                        <p>Language Name <input type="text" name="LocalizedName" value="@Model.LocalizedName" /></p>
                        <p>Default <input type="checkbox" name="IsDefault" @(Model.IsDefault ? "checked" : string.Empty) /></p>
	                </div>

                    <input type="reset" value="Reset" />&nbsp;|&nbsp;<input type="submit" value="Save" />
                </form>
			</div>
        </div>
	</div>	
</div>
